package com.newtouch.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.newtouch.common.Page;
import com.newtouch.model.FASResources;
import com.newtouch.service.FASResourcesService;
import com.newtouch.dao.FASResourcesDao;
import com.newtouch.service.base.impl.BaseServiceImpl;
@Service
public class FASResourcesServiceImpl extends BaseServiceImpl implements
		FASResourcesService {
	@Autowired
	private FASResourcesDao fasresourcesdao;


	public void addFASResources(FASResources fasresources) {
		fasresourcesdao.insertModelObject(fasresources);
	}

	public Integer deleteFASResources(String id) {
		return fasresourcesdao.deleteModelObject(new Long(id));
	}

	public Integer editFASResources(FASResources fasresources) {
		return fasresourcesdao.updateModelObject(fasresources);
	}

	public FASResources findFASResourcesById(String id) {
		return fasresourcesdao.getModelObject(new Long(id));
	}

	public List<FASResources> findFASResourcess(Page page) {
		return fasresourcesdao.selectModelObjectListPage(page);
	}

	public List<FASResources> findByRoleCode(String roleCode) {
		Map<String, String> paraMap=new HashMap<String, String>();
		paraMap.put("roleCode",roleCode);
		return fasresourcesdao.selectModelObjectListWithSQLID("FASResources.selectByRoleId", paraMap);
	}

}